package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.OrderStatus;
import com.rockcent.mall.lib.domain.enumclass.PaymentMethod;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by HK on 16/10/26.
 * 分销市场订单
 */
@Table(name = "market_order")
@Entity
@DynamicInsert
@DynamicUpdate
public class MarketOrder extends IDEntityMall {

    @Column(columnDefinition = "varchar(100) comment '分销订单号'")
    private String orderNum;
    @Column(columnDefinition = "bigint comment '供应商 平台id'")
    private Long supplierMallId;
    @Column(columnDefinition = "bigint comment '供应商产品 id'")
    private Long supplierProductId;
    @Column(columnDefinition = "bigint comment '供应商 id'")
    private Long supplierMerchantId;
    @Column(columnDefinition = "varchar(100) comment '供应商 名称'")
    private String supplierMerchatName;
    @Column(columnDefinition = "bigint comment '分销商 平台id'")
    private Long distributorMallId;
    @Column(columnDefinition = "bigint comment '分销商产品 id'")
    private Long distributorProductId;
    @Column(columnDefinition = "bigint comment '分销商 id'")
    private Long distributorMerchantId;
    @Column(columnDefinition = "varchar(100) comment '分销商 名称'")
    private String distributorMerchantName;
    @Column(columnDefinition = "varchar(100) comment '分销商平台订单号'")
    private String distributorMallOrderNum;
    @Column(columnDefinition = "DECIMAL(30,10) comment '订单销售总价'")
    private BigDecimal totalAmount;
    @Column(columnDefinition = "bigint comment '购买数量'")
    private Long buyCount;
    @Column(columnDefinition = "varchar(30) comment '分销市场订单状态'")
    @Enumerated(EnumType.STRING)
    private OrderStatus status;
    @Column(columnDefinition = "varchar(30) comment '支付方式 WECHAT(\"微信\")'")
    @Enumerated(EnumType.STRING)
    private PaymentMethod paymentMethod;
    @Column(columnDefinition = "datetime comment '支付时间'")
    private Date datePayment;

    public OrderStatus getStatus() {
        return status;
    }

    public void setStatus(OrderStatus status) {
        this.status = status;
    }

    public String getDistributorMallOrderNum() {
        return distributorMallOrderNum;
    }

    public void setDistributorMallOrderNum(String distributorMallOrderNum) {
        this.distributorMallOrderNum = distributorMallOrderNum;
    }

    public Long getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(Long buyCount) {
        this.buyCount = buyCount;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public Long getSupplierMallId() {
        return supplierMallId;
    }

    public void setSupplierMallId(Long supplierMallId) {
        this.supplierMallId = supplierMallId;
    }

    public Long getSupplierMerchantId() {
        return supplierMerchantId;
    }

    public void setSupplierMerchantId(Long supplierMerchantId) {
        this.supplierMerchantId = supplierMerchantId;
    }

    public Long getDistributorMallId() {
        return distributorMallId;
    }

    public void setDistributorMallId(Long distributorMallId) {
        this.distributorMallId = distributorMallId;
    }

    public Long getDistributorMerchantId() {
        return distributorMerchantId;
    }

    public void setDistributorMerchantId(Long distributorMerchantId) {
        this.distributorMerchantId = distributorMerchantId;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public Long getSupplierProductId() {
        return supplierProductId;
    }

    public void setSupplierProductId(Long supplierProductId) {
        this.supplierProductId = supplierProductId;
    }

    public Long getDistributorProductId() {
        return distributorProductId;
    }

    public void setDistributorProductId(Long distributorProductId) {
        this.distributorProductId = distributorProductId;
    }

    public PaymentMethod getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(PaymentMethod paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public Date getDatePayment() {
        return datePayment;
    }

    public void setDatePayment(Date datePayment) {
        this.datePayment = datePayment;
    }

    public String getSupplierMerchatName() {
        return supplierMerchatName;
    }

    public void setSupplierMerchatName(String supplierMerchatName) {
        this.supplierMerchatName = supplierMerchatName;
    }

    public String getDistributorMerchantName() {
        return distributorMerchantName;
    }

    public void setDistributorMerchantName(String distributorMerchantName) {
        this.distributorMerchantName = distributorMerchantName;
    }

    @Override
    public String toString() {
        return "MarketOrder{" +
                "id=" + id +
                ", orderNum='" + orderNum + '\'' +
                ", supplierMallId=" + supplierMallId +
                ", dateCreated=" + dateCreated +
                ", supplierProductId=" + supplierProductId +
                ", lastUpdated=" + lastUpdated +
                ", supplierMerchantId=" + supplierMerchantId +
                ", supplierMerchatName='" + supplierMerchatName + '\'' +
                ", isDelete=" + isDelete +
                ", version=" + version +
                ", distributorMallId=" + distributorMallId +
                ", distributorProductId=" + distributorProductId +
                ", distributorMerchantId=" + distributorMerchantId +
                ", distributorMerchantName='" + distributorMerchantName + '\'' +
                ", distributorMallOrderNum='" + distributorMallOrderNum + '\'' +
                ", totalAmount=" + totalAmount +
                ", buyCount=" + buyCount +
                ", status=" + status +
                ", paymentMethod=" + paymentMethod +
                ", datePayment=" + datePayment +
                '}';
    }
}
